package com.gaussic.repository;

import com.gaussic.model.ProposalCheckEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
@Repository
public interface ProposalCheckRepository extends JpaRepository<ProposalCheckEntity, Integer> {

    // 修改博文操作
    @Modifying
    @Transactional
    @Query("update ProposalCheckEntity PC set PC.readerId=:qReaderId, PC.readerAt=:qReaderAt, PC.comment=:qComment , PC.opt=:qOpt, PC.proposalId=:qProposalId where PC.id=:qId")
    void updateBlog(@Param("qReaderId") int readerId,@Param("qReaderAt") Date readerAt, @Param("qComment") String comment, @Param("qOpt") int opt, @Param("qProposalId") int proposalId, @Param("qId") int id);
}
